home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
begincpp
/
#6.c
< prev
next >
Wrap
Text File
|
1990-08-01
|
7KB
|
213 lines
#line 1 "#6.cxx"
void *_new(long);
void _delete(void*);
void *_vec_new(void*,int,int,void*(*)(void*));
void _vec_delete(void*,int,int,void(*)(void*,int),...);
void exit(int);
static void cdecl _STI();
static void cdecl _STD();
typedef unsigned int size_t ;
typedef char *va_list ;
struct _iobuf {
char *__iobuf__ptr ;
int __iobuf__cnt ;
char *__iobuf__base ;
char __iobuf__flag ;
char __iobuf__file ;} ;
extern struct _iobuf _iob [];
int _filbuf (struct _iobuf *);
int _flsbuf (int , struct _iobuf *);
void clearerr (struct _iobuf *);
int fclose (struct _iobuf *);
int fcloseall (void );
struct _iobuf *fdopen (int , char *);
int fflush (struct _iobuf *);
int fgetc (struct _iobuf *);
int fgetchar (void );
int fgetpos (struct _iobuf *, long *);
char *fgets (char *, int , struct _iobuf *);
int flushall (void );
struct _iobuf *fopen (char *, char *);
int fprintf (struct _iobuf *, char *, ... );
int fputc (int , struct _iobuf *);
int fputchar (int );
int fputs (char *, struct _iobuf *);
size_t fread (void *, size_t , size_t , struct _iobuf *);
struct _iobuf *freopen (char *, char *, struct _iobuf *);
int fscanf (struct _iobuf *, char *, ... );
int fsetpos (struct _iobuf *, long *);
int fseek (struct _iobuf *, long , int );
long ftell (struct _iobuf *);
size_t fwrite (void *, size_t , size_t , struct _iobuf *);
char *gets (char *);
int getw (struct _iobuf *);
void perror (char *);
int printf (char *, ... );
int puts (char *);
int putw (int , struct _iobuf *);
int remove (char *);
int rename (char *, char *);
void rewind (struct _iobuf *);
int rmtmp (void );
int scanf (char *, ... );
void setbuf (struct _iobuf *, char *);
int setvbuf (struct _iobuf *, char *, int , size_t );
int sprintf (char *, char *, ... );
int sscanf (char *, char *, ... );
char *tempnam (char *, char *);
struct _iobuf *tmpfile (void );
char *tmpnam (char *);
int ungetc (int , struct _iobuf *);
int unlink (char *);
int vfprintf (struct _iobuf *, char *, va_list );
int vprintf (char *, va_list );
int vsprintf (char *, char *, va_list );
void *memccpy (void *, void *, int , unsigned int );
void *memchr (void *, int , size_t );
int memcmp (void *, void *, size_t );
int memicmp (void *, void *, unsigned int );
void *memcpy (void *, void *, size_t );
void *memmove (void *, void *, size_t );
void *memset (void *, int , size_t );
void movedata (unsigned int , unsigned int , unsigned int , unsigned int , unsigned int );
char *strcat (char *, char *);
char *strchr (char *, int );
int strcmp (char *, char *);
int strcmpi (char *, char *);
int stricmp (char *, char *);
char *strcpy (char *, char *);
size_t strcspn (char *, char *);
char *strdup (char *);
char *_strerror (char *);
char *strerror (int );
size_t strlen (char *);
char *strlwr (char *);
char *strncat (char *, char *, size_t );
int strncmp (char *, char *, size_t );
int strnicmp (char *, char *, size_t );
char *strncpy (char *, char *, size_t );
char *strnset (char *, int , size_t );
char *strpbrk (char *, char *);
char *strrchr (char *, int );
char *strrev (char *);
char *strset (char *, int );
size_t strspn (char *, char *);
char *strstr (char *, char *);
char *strtok (char *, char *);
char *strupr (char *);
struct student {
int _student_pr_member ;
int _student_student_id ;
float _student_gpa ;
char _student_name [15];
char _student_college [12];
char _student_major [14];
int _student_yr ;
} ;
extern char *l_char (int );
extern char *y_char (int );
struct grad_student {
int _student_pr_member ;
int _student_student_id ;
float _student_gpa ;
char _student_name [15];
char _student_college [12];
char _student_major [14];
int _student_yr ;
int _grad_student_s ;
char _grad_student_dept [15];
char _grad_student_thesis [50];
} ;
extern char *s_char (int );
void proc1 (struct student *);
void proc2 (struct grad_student *);
int main ()
{
{
struct student _au1_s1 ;
struct grad_student _au1_gs1 ;
( ( ( ((& _au1_s1 )-> _student_pr_member = 0), 0 ) ,
( ((& _au1_s1 )-> _student_student_id = 100 ),
( ((& _au1_s1 )-> _student_gpa = ((float )2.99 )),
(((& _au1_s1 )))) ) ) ) ;
( ( (( ( ( ((((struct student *)
(& _au1_gs1 )))-> _student_pr_member = 0), 0 ) ,
( ((((struct student *)(& _au1_gs1 )))-> _student_student_id = 200 ),
( ((((struct student *)(& _au1_gs1 )))-> _student_gpa
= ((float )3.01 )), (((((struct student *)(& _au1_gs1 )))))) ) ) ) ),
( ((& _au1_gs1 )-> _grad_student_s = 0), (((& _au1_gs1 )))) ) ) ;
proc1 ( (struct student *)(& _au1_s1 )) ;
( printf ( (char *)"%-15s %-15s %4d %-12s %-14s %-9s %4.2f\n",
l_char ( (& _au1_s1 )-> _student_pr_member ) ,
(& _au1_s1 )-> _student_name , (& _au1_s1 )-> _student_student_id ,
(& _au1_s1 )-> _student_college , (& _au1_s1 )-> _student_major ,
y_char ( (& _au1_s1 )-> _student_yr ) ,
(& _au1_s1 )-> _student_gpa ) ) ;
proc2 ( (struct grad_student *)(& _au1_gs1 )) ;
( printf ( (char *)"%-15s%-10s %-50s\n",
(& _au1_gs1 )-> _grad_student_dept ,
s_char ( (& _au1_gs1 )-> _grad_student_s ) ,
(& _au1_gs1 )-> _grad_student_thesis ) ) ;
}
exit ( 0 );
}
extern void proc1 (struct student *_au0_sp )
{
strcpy ( (*_au0_sp ). _student_name , (char *)"Loope deLoop") ;
strcpy ( (*_au0_sp ). _student_college , (char *)"Art&Science") ;
strcpy ( (*_au0_sp ). _student_major , (char *)"French") ;
(*_au0_sp ). _student_yr = 3;
}
extern void proc2 (struct grad_student *_au0_gsp )
{
strcpy ( (*_au0_gsp ). _student_name , (char *)"Yogi Bear") ;
strcpy ( (*_au0_gsp ). _grad_student_dept , (char *)"Entertainment") ;
strcpy ( (*_au0_gsp ). _student_college , (char *)"Business") ;
strcpy ( (*_au0_gsp ). _grad_student_thesis , (char *)"10000 ways to be smarter than the average bears") ;
strcpy ( (*_au0_gsp ). _student_major , (char *)"") ;
}
extern char *l_char (int _au0_l )
{
switch (_au0_l ){
case 0: return "Undergraduate";
case 1: return "Graduate";
}
}
extern char *y_char (int _au0_yr )
{
switch (_au0_yr ) {
case 0: return "Freshman";
case 1: return "Sophomore";
case 2: return "Junior";
case 3: return "Senior";
}
}
extern char *s_char (int _au0_s )
{
switch (_au0_s ) {
case 0: return "Ta";
case 1: return "Ra";
case 2: return "Fellowship";
case 3: return "Other";
}
}